﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Frame.master" AutoEventWireup="true" CodeFile="color.aspx.cs" Inherits="color" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleHolder" Runat="Server">
<asp:Label ID="lblTitle" runat="server" Text="Quản lý màu xe"></asp:Label>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" Runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <script type="text/javascript">
        /*Card Type Page*/
        function CheckCardForm() {
            var error = document.getElementById("errorName");
            var control = document.getElementById("ctl00_ContentHolder_txtName");
            if (control.value == "") {
                control.focus();
                error.style.display = 'block';
                return false;
            }
            return true;
        }
    </script>
<table width="930" border="0" align="center" cellpadding="3" cellspacing="1" class="margin_l150">
        <tr>
            <td align="left" valign="top" width="100">
               Màu xe</td>
            <td align="left" valign="top">
                <table cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td width="214" align="left"><asp:TextBox ID="txtName" runat="server" CssClass="width_200" MaxLength="50"></asp:TextBox></td>
                        <td><span id="errorName" style="display:none" class="errorMsg">&nbsp</span><asp:Label 
                                ID="lblErrorName" runat="server" ForeColor="#FF3300"></asp:Label>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                Mô tả</td>
            <td align="left" valign="top">
                <asp:TextBox ID="txtDes" runat="server" CssClass="width_200" 
                    TextMode="MultiLine" MaxLength="100" Rows="3"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                &nbsp;
                <asp:HiddenField ID="hdnId" runat="server" />
            </td>
            <td align="left" valign="top">
            <asp:ImageButton ID="btnSave" OnClientClick="return CheckCardForm()" runat="server" ImageUrl="~/images/save.gif" OnClick="btnSave_Click" />
                <asp:ImageButton ID="btnReset" runat="server" ImageUrl="~/images/xoa.gif" 
                    OnClick="btnReset_Click" CausesValidation="False" /></td>
             
        </tr>
    </table>
    
    <div align="center"> <asp:Label ID="lblMsg" runat="server" ForeColor="#FF3300"></asp:Label></div>
        
     <table width="680" border="0" cellpadding="0" cellspacing="0" class="margin_b5 margin_l100">
        <tr>
            <td class="titleInfo">
                Danh sách màu xe
            </td>
        </tr>
    </table>
    <div align="center" style="width:600px"> <asp:Label ID="lblInform" runat="server" ForeColor="#FF3300"></asp:Label></div>
     <asp:Repeater ID="rptColor" runat="server" onitemcommand="rptColor_ItemCommand" EnableViewState="false">
        <HeaderTemplate>
            <table width="680" border="0" align="left" cellpadding="5" cellspacing="1" class="margin_l100 tableBackground">
                    <tr>
                        <td class="tableheader" width="20"><b>STT</b></td>
                        <td width="150" align="center" class="tableheader"><b>Màu xe</b></td>
                        <td align="left" class="tableheader"><b>Mô tả</b></td>
                        <td width="180" align="center" class="tableheader"><b>Người cập nhật sau cùng</b></td>
                        <td colspan="2" align="center" class="tableheader"><b>Thao tác</b></td>
                    </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr class="tableContentEven">
                <td align="center"><asp:Label ID="lblNo" runat="server" Text="<%# Container.ItemIndex + 1 %>"></asp:Label></td>
                <td align="left" valign="top"><%#Eval("Name")%></td>
                <td align="left" valign="top"><%#Eval("Description")%></td>
                 <td width="30" align="left" valign="top"><%#Eval("LastUser.FirstName")%> <%#Eval("LastUser.LastName")%></td> 
                <td width="30" align="center" valign="top">
                <asp:ImageButton ID="btnEdit"  runat="server" ImageUrl="~/images/edit.png" ToolTip="Chỉnh sửa" Width="14" Height="13" CommandName="Edit" CommandArgument='<%#Eval("Id")%>'/>
                </td>               
                <td width="30" align="center" valign="top">
                    <asp:ImageButton ID="btnDelete" OnClientClick="return confirm('Bạn chắc chắn muốn xóa?')" ImageUrl="~/images/delete.gif" ToolTip="Xóa" runat="server" CommandName="Delete" CommandArgument='<%#Eval("Id")%>'/>
                    <asp:HiddenField ID="hdnId" runat="server" Value='<%#Eval("Id")%>'/>                   
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
        </table>
        </FooterTemplate>
    </asp:Repeater>
    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

